package sy.service.impl;

import java.io.Serializable;
import java.util.Date;
import java.util.UUID;

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import sy.dao.UserDaoI;
import sy.model.Tuser;
import sy.service.UserServiceI;

@Service("userService")
@Transactional
public class UserServiceImpl implements UserServiceI {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = LogManager.getLogger(UserServiceImpl.class.getName());
	
	@Autowired
	private UserDaoI userDao;

	@Override
	public void save(String name, String pwd) {
		Tuser t = new Tuser();
		t.setId(UUID.randomUUID().toString());
		t.setName(name);
		t.setPwd(pwd);
		t.setCreatedatetime(new Date());
		userDao.save(t);
	}

}
